//
//  KJTableViewCell.m
//  科技头条
//
//  Created by 谢裕湖 on 2017/3/8.
//  Copyright © 2017年 谢裕湖. All rights reserved.
//

#import "KJTableViewCell.h"
#import "UIImageView+WebCache.h"

@interface KJTableViewCell ()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *detailSourceLabel;
@property (weak, nonatomic) IBOutlet UIImageView *image;


@end

@implementation KJTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    //图片等比例缩放
    UIImageView *imageView = [[UIImageView alloc]init];
    
    imageView.contentMode = UIViewContentModeScaleToFill;
}

- (void)setModel:(KJModel *)model{
    
    _model = model;
    
    _titleLabel.text = model.title;
    _timeLabel.text = [NSDate dateWithTimeIntervalSinceNow:[model.addtime doubleValue]].description;
    _detailSourceLabel.text = model.sitename;
    [_image sd_setImageWithURL:[NSURL URLWithString:model.src_img] placeholderImage:[UIImage imageNamed:@"1"]];
}





- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
